package perf.store;

import java.util.List;

import perf.data.Run;

import com.db4o.ObjectContainer;

public class ObjectModify {
	private ObjectContainer store;
	private ObjectList lister;
	
	public ObjectModify( ObjectContainer db, ObjectList lister ) {
		this.store = db;
		this.lister = lister;
	}
	
	public void addSession( Run s ) {
		store.store( s );
		store.commit();
	}
	
	public void deleteSession( int idx ) {
		List<Run> runs = lister.runs();
		Run s = runs.get( idx );
		
		store.delete( s );
	}
}

